<!DOCTYPE html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="/tld/pager.tld" prefix="pager"%> 
<%@ taglib uri="/tld/id2name.tld" prefix="id2name"%> 
<%@ taglib uri="/tld/code2name.tld" prefix="code2name"%> 
<html>
  <head>
    <base href="<%=basePath%>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
	    <link href="<%=basePath%>bs/css/bootstrap.min.css" rel="stylesheet" media="screen">
	    <script type="text/javascript" src="<%=basePath%>js/jquery-1.11.3.min.js"></script>
	    <script type="text/javascript" src="<%=basePath%>bs/js/bootstrap.min.js"></script>
    <title>设备参数标识符列表</title>
    
	<script type="text/javascript">
	var basePath = "<%=basePath%>";
	function del(id){
		$.get("<%=basePath%>tbDevicePara/delTbDevicePara?id=" + id,function(data){
			if("success" == data.result){
				alert("删除成功");
				window.location.reload();
			}else{
				alert("删除失败");
			}
		});
	}
</script>
  </head>
  
  <body>
    <h6><a href="<%=basePath%>tbDevicePara/toAddTbDevicePara">添加设备参数标识符</a></h6>
	<br>
  <div class="container-fluid">
	<div class="row-fluid">
		<div class="span11">
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>id</th>
						<th>devTypeCode</th>
						<th>devParaCode</th>
						<th>devParaName</th>
						<th>devParaUnit</th>
						<th>paraValueType</th>
						<th>paraValueLength</th>
						<th>operate</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${!empty tbDeviceParaList }">
					<c:forEach items="${tbDeviceParaList}" var="tbDevicePara">
					<tr>
						<td>${tbDevicePara.id }</td>
						<td><code2name:do objectCode="${tbDevicePara.devTypeCode }" objectType="tbDeviceType"/> ${tbDevicePara.devTypeCode }</td>
						<td><code2name:do objectCode="${tbDevicePara.devTypeCode }${tbDevicePara.devParaCode }" objectType="tbDevicePara"/>${tbDevicePara.devParaCode }</td>
						<td>${tbDevicePara.devParaName }</td>
						<td>${tbDevicePara.devParaUnit }</td>
						<td>${tbDevicePara.paraValueType }</td>
						<td>${tbDevicePara.paraValueLength }</td>
						<td>
							<a href="tbDevicePara/getTbDevicePara?id=${tbDevicePara.id}">编辑</a>
							<a href="javascript:del('${tbDevicePara.id }')">删除</a>
						</td>
					</tr>
					</c:forEach>
					</c:if>
					</tbody>
				</table>
				<pager:createPager pageUrl="tbDevicePara/getAllTbDevicePara" pageSize="${mypage.pageSize}" totalPage="${mypage.totalPage}" totalCount="${mypage.totalCount}" curPage="${mypage.curPage}" totalCountTimeMillis="${mypage.totalCountTimeMillis}"/> 
			</div>
		</div>
	</div>
  </body>
</html>
